/*
 * A Pythagorean triplet is a set of three natural numbers, a  b  c, for which,
 * a2 + b2 = c2
 * For example, 32 + 42 = 9 + 16 = 25 = 52.
 * There exists exactly one Pythagorean triplet for which a + b + c = 1000.
 * Find the product abc
 */
#include<stdio.h>

/* 2010-03-23 */
int main(void)
{
	int a, b, c;

	for( a=1; a<=1000; a++) {
		for( b=1; b<=1000; b++) {
			for( c=1; c<=1000; c++) {
				if( a*a + b*b == c*c &&
				    a + b + c == 1000 ) 
					printf("abc = %d\n", a*b*c);
			}
		}
	}

	return 0;
}
